package com.tz.online.user.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name="exit",urlPatterns="/user/exit")
public class ExitAction extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1397080066015964885L;

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		//删除session中的用户信息
		req.getSession().removeAttribute("userInfo");
		
		resp.sendRedirect(req.getContextPath()+"/book/IndexAction");
	}

}
